{{- $preUrl := relURL "/" -}}
{{- $staticVendor := "static/vendor/" -}}
{{- $cdnUrl := (partial "functions/cdn/jsdelivr" .) -}}

{{- if hugo.IsProduction -}}
    {{- if eq .Language.LanguageDirection "ltr" -}}
        <link rel="stylesheet" href="{{ $preUrl }}static/vendor/bootstrap/dist/css/bootstrap.min.css">
    {{- else -}}
        <link rel="stylesheet" href="{{ $preUrl }}static/vendor/bootstrap/dist/css/bootstrap.rtl.min.css">
    {{- end -}}
{{- else -}}
    {{- if eq .Language.LanguageDirection "ltr" -}}
        <link rel="stylesheet" href="{{ $preUrl }}static/vendor/bootstrap/dist/css/bootstrap.css">
    {{- else -}}
        <link rel="stylesheet" href="{{ $preUrl }}static/vendor/bootstrap/dist/css/bootstrap.rtl.css">
    {{- end }}
{{- end }}

{{/*<link rel="stylesheet" href="{{ $preUrl }}static/vendor/bootstrap-icons/font/bootstrap-icons.min.css">*/}}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/flag-icons/css/flag-icons.min.css">
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/vanilla-cookieconsent/dist/cookieconsent.css">

{{ if .Site.Params.font_family.enable -}}
    {{- $font_family_name := .Site.Params.font_family.name -}}
    {{- $font_family_css_href := printf "%s%s@callmebill/lxgw-wenkai-web/lxgwwenkai-regular/result.min.css" $preUrl $staticVendor -}}
    <link rel="stylesheet" href={{ $font_family_css_href }}>
{{ end -}}

{{ if in .Page.Params.components "svgedit" }}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/svgedit/dist/editor/svgedit.css">
{{ end }}

{{ if in .Page.Params.components "uppy" }}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/uppy/dist/uppy.min.css">
{{ end }}

{{ if in .Page.Params.components "calendar" }}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/jcalendar.js/dist/calendar.js.min.css">
{{ end }}

{{ if in .Page.Params.components "handsontable" }}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/handsontable/dist/handsontable.full.min.css">
{{ end }}

{{ if in .Page.Params.components "handsontable-simple" }}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/handsontable/dist/handsontable.min.css">
{{ end }}

{{/*<link rel="stylesheet" href="{{ $preUrl }}static/vendor/xgplayer/dist/index.min.css">*/}}

{{ if in .Page.Params.components "datatables" }}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/simple-datatables/dist/style.css">
{{ end }}

{{ if hasPrefix .Type "zhgh" }}
<link rel="stylesheet" href="{{ $preUrl }}static/css/zhgh/common.css">
{{ end }}

{{ if in .Page.Params.components "photoswipe" }}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/photoswipe/dist/photoswipe.css">
{{ end }}

{{ if eq .IsHome false }}
{{ if and (ne .Page.Params.navbar "hide") (ne .Page.Params.onlyMain true) }}
<link rel="stylesheet" href="{{ $preUrl }}static/vendor/@docsearch/css/dist/style.css">
{{ end }}
{{ end }}

{{- if eq .Page.Layout "full_page" -}}
    <link rel="stylesheet" href="{{ $preUrl }}static/css/full_page.css">
{{- end }}

{{- $commonSCSS := partial "functions/stylesheet/toCSS" (dict "resourcesGet" "scss/common/index.scss" "targetPath" "static/css/common.css") }}
<link rel="stylesheet" href="{{ $commonSCSS }}">

{{- $commonCSS := partial "functions/concat" (dict "concatPath" "static/css/common/**.css" "targetPath" "static/css/common.bundle.css") }}
<link rel="stylesheet" href="{{ $commonCSS }}">

{{- $docsCSS := partial "functions/stylesheet/toCSS" (dict "resourcesGet" "scss/bootstrap-doc-css/docs.scss" "targetPath" "static/css/docs.css") }}
<link rel="stylesheet" href="{{ $docsCSS }}">

{{- $fontCSS := partial "functions/stylesheet/toCSS" (dict "resourcesGet" "scss/font/font.scss" "targetPath" "static/css/font.css") }}
<link rel="stylesheet" href="{{ $fontCSS }}">

{{- $glide_all_CSS := partial "functions/stylesheet/toCSS" (dict "resourcesGet" "scss/glide/glide.all.scss" "targetPath" "static/css/glide.all.css") }}
<link rel="stylesheet" href="{{ $glide_all_CSS }}">

{{- $msg_css := partial "functions/stylesheet/postCSS" (dict "resourcesGet" "static/css/post/msg.css" "targetPath" "static/css/post/msg.css") }}
<link rel="stylesheet" href="{{ $msg_css }}">

{{- $post_css := partial "functions/stylesheet/postCSS" (dict "resourcesGet" "static/css/post.css" "targetPath" "static/css/post.css") }}
<link rel="stylesheet" href="{{ $post_css }}">

{{- $tags_css := partial "functions/stylesheet/postCSS" (dict "resourcesGet" "static/css/publish/tags.css" "targetPath" "static/css/publish/tags.css") }}
<link rel="stylesheet" href="{{ $tags_css }}">

{{- $bulletinCSS := partial "functions/stylesheet/postCSS" (dict "resourcesGet" "static/css/bulletin.css" "targetPath" "static/css/bulletin.css") }}
<link rel="stylesheet" href="{{ $bulletinCSS }}">

{{- $printCSS := partial "functions/stylesheet/postCSS" (dict "resourcesGet" "static/css/print.css" "targetPath" "static/css/print.css") }}
<link rel="stylesheet" href="{{ $printCSS }}" media="print">

{{- if eq .Page.Layout "jump_link" -}}
    <link rel="stylesheet" href="{{ $preUrl }}static/css/jump_link.css">
{{- end -}}

{{- $breadcrumbsCSS := partial "functions/stylesheet/postCSS" (dict "resourcesGet" "static/css/breadcrumbs.css" "targetPath" "static/css/breadcrumbs.css") }}

{{- if eq .IsHome false -}}
    {{ if and (ne .Page.Params.breadcrumb "hide") (ne .Page.Params.onlyMain true) }}
        <link rel="stylesheet" href="{{ $breadcrumbsCSS }}">
    {{- end -}}
{{- end -}}

{{ if or (eq .Type "publish") (and (eq .Type "posts") (eq .Kind "page")) -}}
    <link rel="stylesheet" href="{{ $preUrl }}static/vendor/vditor/dist/index.css">
{{ end }}

{{ if hasPrefix .Type "aqxc" }}
    <link rel="stylesheet" href="{{ $preUrl }}static/css/aqxc/common.css">
{{ end }}
